<?php
session_start();
if($_SESSION['userid']==null) {
	echo '<script>window.location="index.php"</script>';
	die();
}
?>
<!DOCTYPE html>
<html lang="en" >
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>学生请假系统</title>
	<link rel="stylesheet" type="text/css" href="common.css">
	<link rel="stylesheet" type="text/css" href="nav.css">
	<link rel="stylesheet" type="text/css" href="layout.css">
	<style type="text/css">
	#home-logo
	{
		margin-top: 10px;
		width: 480px;
		height: 300px;
		vertical-align: middle;
	}
	</style>
</head>
<body>
	<div>
		<div id="layout-head">
			<div id="logo"><img src="img/scnulogo.png"></div>
			<div id="title"><h1>华南师范大学学生请假系统</h1></div>
			<div id="user-info">
				欢迎您，
				<a id="userinfo.php">
					<?php 
						require_once("db_login.php"); 
						$userid = $_SESSION['userid'];
						$sql = "SELECT * FROM t_student WHERE id="."'$userid'";
						$result = mysql_query($sql);
						$row = mysql_fetch_array($result);
						echo $row['name'];
					?>同学
				</a>&nbsp&nbsp
				<a href="logout.php">[退出]</a>
			</div>
		</div>
		<div id="layout-middle">
			<div id="layout-left">
				<ul>
					<li class="selected"><a href="home.php">主页</a></li>
					<li><a href="checking.php">未处理申请</a></li>
					<li><a href="checked.php">已处理申请</a></li>
					<li><a href="reject.php">已拒绝申请</a></li>
					<li><a href="userinfo.php">用户信息</a></li>
				</ul>
			</div>
			<div id="layout-body">
				<div class="body-logo"><img src="img/home.png"></div>
				<div id="body">
					<img src="img/welcome_back.png" id="home-logo">
					<h2>
						<a href="userinfo.php"><?php 
						echo $row['name'];
						?></a> 
						同学，欢迎回来！
					</h2>
					<h3>现在，你可以处理<a href="checking.php" style="text-decoration: underline;">未处理申请</a>
						或查看<a href="checked.php" style="text-decoration: underline;">已处理申请</a>和<a href="reject.php"  style="text-decoration: underline;">已拒绝申请</a></h3>
				</div>
			</div>
		</div>
		<div id="layout-footer">推荐使用Chrome和Firefox浏览<img src="img/ch.png"><img src="img/ff.png"></div>
	</div>
</body>
</html>